package com.fzg.controller;

import com.fzg.common.enums.ResponseWrapper;
import com.fzg.common.model.personal.param.GetCompanyOrUserAllInfoParam;
import com.fzg.common.model.personal.param.UpdateLoginUserInfoParam;
import com.fzg.service.PersonalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * create by fzg
 * 2022/3/15 19:13
 * 个人中心controller
 */

@RestController
@RequestMapping("/personal")
public class PersonalController {

   @Autowired
   private PersonalService personalService;

    /**
     * 获取当前登陆用户或者企业的全部信息
     */
    @GetMapping("/allInfo")
    public ResponseWrapper getCompanyOrUserAllInfo(@Validated GetCompanyOrUserAllInfoParam param){
        return personalService.getCompanyOrUserAllInfo(param);
    }

    /**
     * 登录用户修改自己的信息
     */
    @PostMapping("/updateLoginUserInfo")
    public ResponseWrapper updateLoginUserInfo(@Validated @RequestBody UpdateLoginUserInfoParam param){
        return personalService.updateLoginUserInfo(param);
    }

}
